package consts

import (
	"crypto/md5"
	"fmt"
)

type SupplierType string

const (
	SupplierTrainService  SupplierType = "trainService"
	SupplierFlightService SupplierType = "flightService"
)

type WebhookStatus string

const (
	WebhookStatusPending   WebhookStatus = "pending"
	WebhookStatusFailed    WebhookStatus = "failed"
	WebhookStatusProcessed WebhookStatus = "processed"
)

func StringToMd5(flightNo string) string {
	md5Instance := md5.New()
	md5Instance.Write([]byte(flightNo))
	return fmt.Sprintf("%x", md5Instance.Sum(nil))
}

type SupplierThirdConfigName string

const (
	SupplierThirdConfigNameCtrip     SupplierThirdConfigName = "ctrip"
	SupplierThirdConfigNameTongcheng SupplierThirdConfigName = "tongcheng"
	SupplierThirdConfigNameSabre     SupplierThirdConfigName = "sabre"
	SupplierThirdConfigNameIbe       SupplierThirdConfigName = "IBE"
)
